<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
             class="main-search">
      <el-form-item label="渠道标识" prop="channelSource">
        <el-select v-model="queryParams.channelSource" placeholder="请选择渠道标识" clearable>
          <el-option
            v-for="p in channelSourceList"
            :key="p.channelSource"
            :label="p.channelIdentity"
            :value="p.channelSource"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="手机号" prop="tel">
        <el-input
          v-model="queryParams.tel"
          placeholder="请输入手机号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="推送时间">
        <el-date-picker
          v-model="dateRange"
          style="width: 480px"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:59:59']"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="状态" prop="operateFlag" v-if="pageType == '1'">
        <el-select v-model="queryParams.operateFlag" placeholder="请选择" clearable>
          <el-option
            v-for="p in flagList"
            :key="p.value"
            :label="p.label"
            :value="p.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8" v-if="false">
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['channel:channelPush:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['channel:channelPush:export']"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="channelPushList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="" align="center" prop="id" v-if="true"/>
      <el-table-column label="渠道名称" align="center" prop="channelName"/>
      <el-table-column label="渠道标识" align="center">
        <template slot-scope="scope">
          <span> {{ channelSourceFormat(scope.row.channelSource) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="手机号" align="center" prop="tel"/>
      <el-table-column label="数据来源" align="center" prop="dataSource">

      </el-table-column>
      <el-table-column label="推送时间" align="center" prop="pushTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.pushTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <!--      <el-table-column label="位置" align="center" prop="source">-->
      <!--        <template slot-scope="scope">-->
      <!--          <span>{{ scope.row.source == 1 ? '' : '' }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>      -->
      <el-table-column label="位置" align="center" prop="resultInfo">
        <!--        <template slot-scope="scope">-->
        <!--          <span>{{ scope.row.resultInfo}}</span>-->
        <!--        </template>-->
      </el-table-column>
      <el-table-column label="备注信息" align="center" prop="customerBz" width="400px">
        <template slot-scope="scope">
          <div class="messageCard" v-html="scope.row.customerBz"></div>
        </template>
      </el-table-column>
      <el-table-column label="部门信息" align="center" prop="deptName"/>
      <el-table-column label="业务员" align="center" prop="distributeUser"/>
      <el-table-column label="自动分配业务员" align="center" prop="autoDistributeUser"/>
      <el-table-column label="状态" align="center" prop="operateFlag">
        <template slot-scope="scope">
          <span>{{
              scope.row.operateFlag == '0' ? '成功' : scope.row.operateFlag == '1' ? "待处理" : scope.row.operateFlag == '3' ? "放弃" : ""
            }}</span>
        </template>
      </el-table-column>
      <el-table-column label="结果" align="center" prop="operateResult"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="View"
            @click="handleDetail(scope.row)"
          >详情
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="pushDisOperation(scope.row, '2')"
            v-if="scope.row.operateFlag == 1"
          >分配
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="pushDisOperation(scope.row, '3')"
            v-if="scope.row.operateFlag == 1"
          >放弃
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 详情信息 -->

    <el-dialog title="渠道客户详细" :visible.sync="dialog" width="1000px" append-to-body>
      <el-form :model="channelRequest" label-width="100px" class="page-edit-form"
               :style="{'--form-item-width': '33.33%'}">
        <el-row>
          <el-col :span="8">
            <el-form-item label="姓名：">{{ channelRequest.cname }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="性别：">{{ channelRequest.sex }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="年龄：">{{ channelRequest.age }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="电话：">{{ channelRequest.tel }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="城市：">{{ channelRequest.city }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="区域：">{{ channelRequest.quyu }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="职业：">{{ channelRequest.job }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="类型：">{{ getClassIdFormat(channelRequest.classId) }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="额度：">{{ channelRequest.ed }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="资产情况：">{{ channelRequest.zcqk }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="资产证明：">{{ channelRequest.zczm }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公积金：">{{ channelRequest.gjj }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="社保：">{{ channelRequest.sb }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="商品住宅：">{{ channelRequest.spzz }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="商铺：">{{ channelRequest.sp }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="公寓：">{{ channelRequest.gy }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="写字楼：">{{ channelRequest.xzl }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="房产估价：">{{ channelRequest.fcgj }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="房产：">{{ channelRequest.fc }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="房产面积：">{{ channelRequest.fcmj }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="房产城市：">{{ channelRequest.fccs }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="房屋类型：">{{ channelRequest.fwlx }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车产：">{{ channelRequest.cc }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="汽车品牌：">{{ channelRequest.qcpp }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车价：">{{ channelRequest.cj }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="按揭车：">{{ channelRequest.ajc }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="全款车：">{{ channelRequest.qkc }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="多辆车：">{{ channelRequest.dlc }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="公司名称：">{{ channelRequest.gsmc }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="开票：">{{ channelRequest.kpn }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="纳税：">{{ channelRequest.nsn }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="经营时长：">{{ channelRequest.qyjysz }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="营业执照：">{{ channelRequest.yyzz }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="商业保险：">{{ channelRequest.sybx }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="信用卡：">{{ channelRequest.xyk }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="单位类型：">{{ channelRequest.dwlx }}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="缴纳基数：">{{ channelRequest.gjjjnjs }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="月缴纳金额：">{{ channelRequest.yjnje }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="账户状态：">{{ channelRequest.zhzt }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="缴纳时长：">{{ channelRequest.jnsz }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="信用情况：">{{ channelRequest.xyqk }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="贷款用途：">{{ channelRequest.dkyt }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="投放账户ID：">{{ channelRequest.tfzhid }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="招商需求：">{{ channelRequest.zsxqlx }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="数据组：">{{ channelRequest.sjz }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="备注：">{{ channelRequest.remarks }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="获取时间：">{{ channelRequest.subtime }}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button plain @click="dialog = false">关 闭</el-button>
        </div>
      </template>
    </el-dialog>

    <!--  成方详情信息  -->
    <el-dialog title="渠道客户详细" :visible.sync="cfDialog" width="1000px" append-to-body>
      <el-form :model="cfCrmRequest" label-width="100px" class="page-edit-form"
               :style="{'--form-item-width': '33.33%'}">
        <el-row>
          <el-col :span="8">
            <el-form-item label="姓名：">{{ cfCrmRequest.name }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="城市：">{{ cfCrmRequest.area }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="贷款类型：">{{ cfCrmRequest.loanType }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="手机号：">{{ cfCrmRequest.mobile }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="来源：">{{ cfCrmRequest.source }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="需求额度：">{{ cfCrmRequest.loanAmount }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="备注：">{{ cfCrmRequest.remark }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="领取时间：">{{ cfCrmRequest.receivetime }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="时间戳：">{{ cfCrmRequest.timestamp }}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button plain @click="cfDialog = false">关 闭</el-button>
        </div>
      </template>
    </el-dialog>

    <!-- 添加或修改渠道推送记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="渠道名称" prop="channelName">
          <el-input v-model="form.channelName" placeholder="请输入渠道名称"/>
        </el-form-item>
        <el-form-item label="渠道来源" prop="channelSource">
          <el-input v-model="form.channelSource" placeholder="请输入渠道来源"/>
        </el-form-item>
        <el-form-item label="手机号" prop="tel">
          <el-input v-model="form.tel" placeholder="请输入手机号"/>
        </el-form-item>
        <el-form-item label="推送时间" prop="pushTime">
          <el-date-picker clearable
                          v-model="form.pushTime"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="请选择推送时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 管理员操作记录  -->
    <el-dialog title="操作信息" :visible.sync="operateOpen" width="500px" append-to-body>
      <el-form ref="operateFrom" :model="operateFrom" label-width="80px">
        <el-form-item label="原因" prop="reason" :rules="{required: true, message: '原因不能为空', trigger: 'blur'}">
          <el-input type="textarea" v-model="operateFrom.reason" placeholder="请输入原因"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="pushOperation">确 定</el-button>
        <el-button @click="operateOpen = false">取 消</el-button>
      </div>
    </el-dialog>


    <!-- 公共操作信息   -->
    <el-dialog title="渠道客户详细" :visible.sync="commonDialog" width="1000px" append-to-body>
      <el-form :model="channelRequest" label-width="100px" class="page-edit-form"
               :style="{'--form-item-width': '33.33%'}">
        <el-row>
          <el-col :span="8">
            <el-form-item label="姓名：">{{ channelRequest.cname }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="性别：">{{ channelRequest.sex }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="年龄：">{{ channelRequest.age }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="电话：">{{ channelRequest.tel }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="城市：">{{ channelRequest.city }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="数据来源：">{{ channelRequest.source }}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="获取时间：">{{ channelRequest.subtime }}</el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="备注：">{{ channelRequest.remarks }}</el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button plain @click="commonDialog = false">关 闭</el-button>
        </div>
      </template>
    </el-dialog>

  </div>
</template>

<script>
import {
  listChannelPushDis,
  getChannelPushDis,
  delChannelPushDis,
  addChannelPushDis,
  updateChannelPushDis, pushOperate
} from "@/api/channel/channelPushDis";
import {noListChannelDataConf} from "@/api/channel/channelDataConf";

export default {
  name: "ChannelPushDis",
  data() {
    return {
      pageType: "",
      // 渠道来源
      channelSourceList: [],
      flagList: [
        {
          "label": "成功",
          "value": "0"
        },
        {
          "label": "待处理",
          "value": "1"
        },
        {
          "label": "放弃",
          "value": "3"
        }
      ],
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 渠道推送记录表格数据
      channelPushList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 日期范围
      dateRange: [],
      // 详情弹出框
      dialog: false,
      // 成方渠道详情弹出框
      cfDialog: false,
      commonDialog: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 30,
        channelName: undefined,
        channelSource: undefined,
        dataInfo: undefined,
        tel: undefined,
        pushTime: undefined,
        pageType: undefined,
        operateFlag: undefined
      },
      // 表单参数
      form: {},
      channelRequest: {},
      // 成方渠道信息
      cfCrmRequest: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        channelName: [
          {required: true, message: "渠道名称不能为空", trigger: "blur"}
        ],
        channelSource: [
          {required: true, message: "渠道来源不能为空", trigger: "blur"}
        ],
        dataInfo: [
          {required: true, message: "数据信息不能为空", trigger: "blur"}
        ],
        tel: [
          {required: true, message: "手机号不能为空", trigger: "blur"}
        ],
        pushTime: [
          {required: true, message: "推送时间不能为空", trigger: "blur"}
        ],
        createTime: [
          {required: true, message: "创建时间不能为空", trigger: "blur"}
        ],
      },

      operateFrom: {},
      operateOpen: false,
      operateType: "1",
    };
  },
  created() {
    this.pageType = this.$route.query.pageType;
    this.getList();
    this.getChannelSourceInfo();
  },
  methods: {
    getClassIdFormat(val) {
      // 数据信息
      const classIdList = [
        {
          value: "2",
          label: "房抵"
        },
        {
          value: "3",
          label: "车抵"
        },
        {
          value: "4",
          label: "信抵"
        },
        {
          value: "6",
          label: "信贷"
        },
        {
          value: "12",
          label: "企业"
        },
        {
          value: "14",
          label: "其他"
        }];
      if (val) {
        return classIdList.find(it => it.value === val).label;
      }
      return '';
    },
    /** 查询渠道推送记录列表 */
    getList() {
      this.loading = true;
      this.queryParams.pageType = this.pageType;
      listChannelPushDis(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
        this.channelPushList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        channelName: undefined,
        channelSource: undefined,
        dataInfo: undefined,
        tel: undefined,
        pushTime: undefined,
        createBy: undefined,
        createTime: undefined,
        updateBy: undefined,
        updateTime: undefined,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加渠道推送记录";
    },
    /** 渠道标识信息调整 */
    getChannelSourceInfo() {
      noListChannelDataConf().then(res => {
        this.channelSourceList = res.data;
      });
    },
    /** 修改按钮操作 */
    // handleUpdate(row) {
    //   this.loading = true;
    //   this.reset();
    //   const id = row.id || this.ids
    //   getChannelPushDis(id).then(response => {
    //     this.loading = false;
    //     this.form = response.data;
    //     this.open = true;
    //     this.title = "修改渠道推送记录";
    //   });
    // },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          if (this.form.id != null) {
            updateChannelPushDis(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addChannelPushDis(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },

    /** 详情信息 */
    handleDetail(row) {
      const id = row.id || this.ids
      getChannelPushDis(id).then(response => {
        this.loading = false;
        const channelSource = response.data.channelSource;
        if (channelSource == 'crm_channel') {
          this.channelRequest = response.data.channelRequest;
          this.dialog = true;
        } else if (channelSource == 'cf_crm_channel') {
          this.cfCrmRequest = response.data.cfCrmRequest;
          this.cfDialog = true;
        } else {
          this.channelRequest = response.data.channelRequest;
          this.commonDialog = true;
        }
      });
    },

    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除渠道推送记录编号为"' + ids + '"的数据项？').then(() => {
        this.loading = true;
        return delChannelPushDis(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('channel/channelPush/export', {
        ...this.queryParams
      }, `channelPush_${new Date().getTime()}.xlsx`)
    },

    // 渠道信息翻译
    channelSourceFormat(val) {
      return this.channelSourceList.find(it => it.channelSource == val)?.channelIdentity;
    },

    pushDisOperation(row, type) {
      const id = row.id || this.ids
      this.operateFrom = {
        id: id,
        channelName: row.channelName,
        channelSource: row.channelSource,
        channelPushId: row.channelPushId,
        customerId: row.customerId,
        totalCustomerId: row.totalCustomerId,
        userId: row.userId,
        tel: row.tel,
        type: type,
        reason: ""
      }
      this.operateType = type;
      this.operateOpen = true;
    },
    // 渠道信息操作 1、放弃 2、分配
    pushOperation() {
      this.$refs["operateFrom"].validate(valid => {
        if (valid) {
          pushOperate(this.operateFrom).then(() => {
            this.operateOpen = false
            this.getList();
            this.$modal.msgSuccess("操作成功");
          })
        }
      });

    },
  }
};
</script>
<style scoped>
.messageCard {
  overflow-x: hidden;
  overflow-y: scroll;
  word-break: break-all;
  width: 400px;
  max-height: 100px;
  text-align: left;
  float: left;
  text-align: left;
  text-overflow: ellipsis;
  color: #313131;
}

.messageCard::-webkit-scrollbar {
  width: 4px;
}

.messageCard::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.messageCard::-webkit-scrollbar-track {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}
</style>
